<!--纳税信息-->
<template>
  <view class="" style="padding-bottom: 40rpx">
    <view v-if="Object.keys(taxList)" class="">
      <view class="uni-card paddingL15 cardContent">
        <view v-show="taxType">
          <view class="row itemTitle" style="padding: 25rpx">
            <view class="w70">纳税信用等级</view>
            <view class="w30 marginL16">{{
              taxList.evaluationResult
                ? taxList.evaluationResult.includes("具体原因")
                  ? "-"
                  : taxList.evaluationResult
                : "-"
            }}</view>
          </view>
          <view class="row" style="padding: 25rpx">
            <view class="w70">纳税人种类</view>
            <view class="w30 marginL16">{{
              taxList.qualification ? taxList.qualification : "-"
              }}</view>
          </view>
          <view class="row itemTitle" style="padding: 25rpx">
            <view class="w70">纳税人种类生效日期</view>
            <view class="w30 marginL16">{{
              taxList.qualificationValidFrom
                ? taxList.qualificationValidFrom.slice(0, 10)
                : "-"
            }}</view>
          </view>
          <view class="row" style="padding: 25rpx">
            <view class="w70">税务登记日期</view>
            <view class="w30 marginL16">{{
              taxList.taxRegister ? taxList.taxRegister.slice(0, 10) : "-"
              }}</view>
          </view>
          <view class="row itemTitle" style="padding: 25rpx">
            <view class="w70">历史有无欠税记录</view>
            <view class="w30 marginL16">{{
              taxList.unpaidTaxStatus ? "有" : "无"
              }}</view>
          </view>
          <view class="row" style="padding: 25rpx">
            <view class="w70">近1年欠税记录数</view>
            <view class="w30 marginL16">{{
              taxList.taxDelinquencyRecordCountPast12Months
                ? taxList.taxDelinquencyRecordCountPast12Months
                : "-"
            }}</view>
          </view>
          <view class="row itemTitle" style="padding: 25rpx">
            <view class="w70">近1年最大连续0纳税申报月数</view>
            <view class="w30 marginL16">{{
              taxList.last12MaxZeroTaxMonths
                ? taxList.last12MaxZeroTaxMonths
                : "-"
            }}</view>
          </view>
          <view class="row" style="padding: 25rpx">
            <view class="w70">滞纳金情况</view>
            <view class="w30 marginL16">{{
              taxList.lateFeesStatus ? "有" : "无"
              }}</view>
          </view>
          <view class="row itemTitle" style="padding: 25rpx">
            <view class="w70">当前欠税金额(元)</view>
            <view class="w30 marginL16">{{
              taxList.unpaidTaxAmount ? $p(taxList.unpaidTaxAmount) : "0"
              }}</view>
          </view>
        </view>
      </view>
    </view>



    <view class="paddingL15">
      <view class="row title">
        <view class="row" style="justify-content: flex-start; margin: 20rpx 0">
          <view style="
		        width: 5px;
		        height: 18px;
		        border-radius: 8rpx;
		        background: #488afd;
		        margin-right: 20rpx;
		      "></view>
          <text style="font-weight: 500">近三年纳税信息</text>
        </view>
        <view class="row tabClass">
          <view class="first" :class="current == 0 ? 'active' : ''" @click="tabClick(0)">正税</view>
          <view class="first second" :class="current == 1 ? 'active' : ''" @click="tabClick(1)">附加税</view>
        </view>
      </view>
      <view v-if="current == 0" class="row" style="
		    justify-content: flex-start;
		    align-items: flex-start;
		    color: #999999;
		    font-size: 26rpx;
		    margin-bottom: 20rpx;
		  ">
        <view style="white-space: nowrap">温馨提示：</view>
        <view>正税主要包含增值税、企业所得税、车辆税的税费之和；</view>
      </view>
      <view v-if="current == 1" class="row" style="
		    justify-content: flex-start;
		    align-items: flex-start;
		    color: #999999;
		    font-size: 26rpx;
		    margin-bottom: 20rpx;
		  ">
        <view style="white-space: nowrap">温馨提示：</view>
        <view>附加税主要包含城市维护建设税、教育费附加、地方教育费附加，以及消费税、资源税、房产税、城镇土地使用税、车船税、印花税等</view>
      </view>
      <view class="taxTable" v-show="threeType" style="position: relative">
        <view v-if="isDemo != ''" style="
		      position: absolute;
		      z-index: 99;
		      left: 50%;
		      top: 50%;
		      transform: translate(-50%, -50%);
		    ">
          <image src="/pagesWater/static/waterLogo.png" style="width: 320rpx; height: 200rpx"></image>
        </view>
        <!-- 添加组件 -->
        <tableData :tableTitleData="arrobj">
          <view style="display: flex" class="data-row" v-for="(item, index) in objarr" :key="index">
            <view :style="{ width: 100 / objarr.length + '%' }" class="data-cell">{{ item.month }}</view>
            <view :style="{ width: 100 / objarr.length + '%' }" class="data-cell" v-for="(v, i) in arrobj.length - 1"
              :key="i">{{ $p(item["price" + (i + 1)]) }}</view>
          </view>
          <view v-if="JSON.stringify(objarr) == '[]'" style="
		        text-align: center;
		        line-height: 100rpx;
		        height: 100rpx;
		        font-size: 26rpx;
		        color: #888888;
		      ">
            暂无数据
          </view>
        </tableData>
      </view>
    </view>


    <view class="uni-card paddingL15 cardContent">
      <view class="row title">
        <view class="row" style="justify-content: flex-start">
          <view style="
              width: 5px;
              height: 18px;
              border-radius: 8rpx;
              background: #488afd;
              margin-right: 20rpx;
            "></view>
          <text style="font-weight: 500">纳税数据分析</text>
        </view>
        <view class="row" style="justify-content: flex-start">
          <view style="width: 24rpx; height: 32rpx; margin-right: 10rpx">
            <image src="/pagesWater/static/rightMore.png" style="width: 100%; height: 100%"></image>
          </view>
          <view style="color: #999999; font-size: 26rpx">左滑查看更多</view>
        </view>
      </view>
      <view class="taxAnaly row">
        <!-- 添加组件 -->
        <view style="width: 100%; overflow-x: auto; position: relative">
          <view v-if="isDemo != ''" style="
              position: absolute;
              z-index: 99;
              left: 50%;
              top: 50%;
              transform: translate(-50%, -50%);
            ">
            <image src="/pagesWater/static/waterLogo.png" style="width: 320rpx; height: 200rpx"></image>
          </view>
          <tableData :tableType="'column'" :tableData="taxFinArr">
            <view style="display: flex" class="data-row" v-for="(item, index) in taxFinArr" :key="index">
              <view :style="{
                width: 100 / taxFinArr.length + '%',
                padding: index == 0 ? '28rpx 12rpx' : '20rpx 12rpx',
                background: index == 0 ? '#F1F5F9' : '',
              }" class="data-cell" v-for="(v, i) in taxAnalyTitle.length - 1" :key="i">
                <view v-if="index == 0">
                  {{ item["price" + (i + 1)] }}
                </view>
                <view v-else>
                  <view v-if="
                    !['0申报月数'].includes(
                      item.month
                    )
                  ">
                    {{ $p(item["price" + (i + 1)]) }}
                  </view>
                  <view v-else-if="item.month == '滞纳金次数'">
                    {{ item["price" + (i + 1) ] ? item["price" + (i + 1) ] : "0" }}
                  </view>
                  <view v-else-if="['负债率', '利润率'].includes(item.month)">

                    {{ item["price" + (i + 1)] && item["price" + (i + 1)] != '-' ? item["price" + (i + 1)] == 0 ? '0' :
                      $p(item["price" + (i + 1)]) + '%' : '-' }}

                  </view>
                  <view v-else>{{ item["price" + (i + 1)] }}</view>
                </view>
              </view>
            </view>
            <view v-if="finTitle.length == 1" style="
                text-align: center;
                line-height: 100rpx;
                height: 100rpx;
                font-size: 26rpx;
                color: #888888;
              ">
              暂无数据
            </view>
          </tableData>
        </view>
      </view>

      <view class="row title">
        <view class="row" style="justify-content: flex-start; margin: 20rpx 0">
          <view style="
              width: 5px;
              height: 18px;
              border-radius: 8rpx;
              background: #488afd;
              margin-right: 20rpx;
            "></view>
          <text style="font-weight: 500">滞纳金情况</text>
        </view>
        <view style="color: #1a90fd" v-if="tableMoneyData.length > 3" @click="moneyClick">
          {{ moneyType ? "收起列表" : "展开列表" }}
        </view>
      </view>
      <view style="position: relative">
        <view v-if="isDemo != ''" style="
            position: absolute;
            z-index: 99;
            left: 50%;
            top: 50%;
            transform: translate(-50%, -50%);
          ">
          <image src="/pagesWater/static/waterLogo.png" style="width: 320rpx; height: 200rpx"></image>
        </view>
        <table-data :tableTitleData="titleMoney">
          <view style="display: flex" class="data-row" v-for="(item, index) in tableMoneyData" :key="index"
            v-if="index + 1 <= moneyIndex">
            <view class="data-cell" :style="{ width: 100 / titleMoney.length + '%' }">
              {{ item.taxPeriodStart }}
            </view>
            <view class="data-cell" :style="{ width: 100 / titleMoney.length + '%' }">{{ item.paymentDate }}
            </view>
            <view class="data-cell" :style="{ width: 100 / titleMoney.length + '%' }">
              {{ $p(item.paymentAmount) }}
            </view>
          </view>
          <view v-if="tableMoneyData.length == 0" style="
              text-align: center;
              line-height: 100rpx;
              height: 100rpx;
              font-size: 26rpx;
              color: #888888;
            ">
            暂无数据
          </view>
        </table-data>
      </view>

      <view class="row title" style="justify-content: flex-start; margin: 24rpx 0">
        <view style="
            width: 5px;
            height: 18px;
            border-radius: 8rpx;
            background: #488afd;
            margin-right: 20rpx;
          "></view>
        <text style="font-weight: 500">近两年纳税信用评级</text>
      </view>
      <view style="position: relative">
        <view v-if="isDemo != ''" style="
            position: absolute;
            z-index: 99;
            left: 50%;
            top: 50%;
            transform: translate(-50%, -50%);
          ">
          <image src="/pagesWater/static/waterLogo.png" style="width: 320rpx; height: 200rpx"></image>
        </view>
        <table-data :tableTitleData="titleData1">
          <view style="display: flex" class="data-row" v-for="(item, index) in tableData2" :key="index">
            <view :style="{ width: 100 / titleData1.length + '%' }" class="data-cell">
              {{ item.evaluationYear }}
            </view>
            <view :style="{ width: 100 / titleData1.length + '%' }" class="data-cell">
              {{ item.evaluationScore }}
            </view>
            <view :style="{ width: 100 / titleData1.length + '%' }" class="data-cell">
              <!-- #ifdef H5 || APP-PLUS || MP-WEIXIN -->
              <readMore :isPopup="true" :title="titleData1[2].title" hideLineNum="2" showHeight="100">{{
                item.evaluationResult.length > 0 ? item.evaluationResult : "-"
              }}
                <template #content>
                  <view>{{ item.evaluationResult.length > 0 ? item.evaluationResult : "-" }}</view>
                </template>
              </readMore>
              <!-- #endif -->
              <!-- #ifdef MP-TOUTIAO -->
              <uv-read-more :shadowStyle="shadowStyle" closeText="全部" textIndent="0" openText="收起" show-height="100rpx"
                :toggle="true">
                {{
                  item.evaluationResult.length > 0 ? item.evaluationResult : "-"
                }}
              </uv-read-more>
              <!-- #endif -->
            </view>
            <view :style="{ width: 100 / titleData1.length + '%' }" class="data-cell">
              <!--//item.indicatorNames-->
              <!-- #ifdef H5 || APP-PLUS || MP-WEIXIN -->
              <readMore :isPopup="true" :title="titleData1[3].title" hideLineNum="2" showHeight="80">
                {{ item.indicatorNames.length > 0 ? item.indicatorNames.join(",") : "-" }}
                <template #content>
                  <view>{{ item.indicatorNames.length > 0 ? item.indicatorNames.join("；") : "-" }}</view>
                </template>
              </readMore>
              <!-- #endif -->
              <!-- #ifdef MP-TOUTIAO -->
              <uv-read-more :shadowStyle="shadowStyle" closeText="全部" textIndent="0" openText="收起" show-height="100rpx"
                :toggle="true">
                {{
                  item.indicatorNames.length > 0
                    ? item.indicatorNames.join(",")
                    : "-"
                }}
              </uv-read-more>
              <!-- #endif -->
            </view>
          </view>
          <view v-if="tableData2.length == 0" style="
              text-align: center;
              line-height: 100rpx;
              height: 100rpx;
              font-size: 26rpx;
              color: #888888;
            ">
            暂无数据
          </view>
        </table-data>
      </view>



      <view class="row title">
        <view class="row" style="justify-content: flex-start; margin: 20rpx 0">
          <view style="
              width: 5px;
              height: 18px;
              border-radius: 8rpx;
              background: #488afd;
              margin-right: 20rpx;
            "></view>
          <text style="font-weight: 500">税务违法违规信息</text>
        </view>



        <view class="row" style="justify-content: flex-start">
          <view style="width: 24rpx; height: 32rpx; margin-right: 10rpx">
            <image src="/pagesWater/static/rightMore.png" style="width: 100%; height: 100%"></image>
          </view>
          <view style="color: #999999; font-size: 26rpx">左滑查看更多</view>
        </view>
      </view>
      <view class="taxAnaly row">
        <view style="width: 100%; overflow-x: auto; position: relative">
          <view v-if="isDemo != ''" style="
              position: absolute;
              z-index: 99;
              left: 50%;
              top: 50%;
              transform: translate(-50%, -50%);
            ">
            <image src="/pagesWater/static/waterLogo.png" style="width: 320rpx; height: 200rpx"></image>
          </view>
          <table-data
            :rightWidth="lawRegulationViolationTitle.length > 3 ? lawRegulationViolationTitle.length * 46 : ''"
            :colWidth="'46'" :tableType="'column'" :tableData="lawRegulationViolationData">

            <view style="display: flex" class="data-row" v-for="(item, index) in lawRegulationViolationData"
              :key="index">
              <view :style="{
                width: 100 / lawRegulationViolationData.length + '%',
                padding: index == 0 ? '28rpx 12rpx' : '20rpx 12rpx',
                background: index == 0 ? '#F1F5F9' : '',
              }" class="data-cell" v-for="(v, i) in lawRegulationViolationTitle.length" :key="i">
                <readMore :key="index + i" :isPopup="true" hideLineNum="1" showHeight="50">
                  {{ item["value" + (i)] }}
                  <template #content>
                    <view>{{ item["value" + (i)] }}</view>
                  </template>
                </readMore>
              </view>
            </view>
          </table-data>
        </view>

      </view>
      <view class="financial row" style="position: relative">
        <view v-if="isDemo != ''" style="
            position: absolute;
            z-index: 99;
            left: 50%;
            top: 50%;
            transform: translate(-50%, -50%);
          ">
          <image src="/pagesWater/static/waterLogo.png" style="width: 320rpx; height: 200rpx"></image>
        </view>
      </view>

      <view class="row title">
        <view class="row" style="justify-content: flex-start; margin: 20rpx 0">
          <view style="
              width: 5px;
              height: 18px;
              border-radius: 8rpx;
              background: #488afd;
              margin-right: 20rpx;
            "></view>
          <text style="font-weight: 500">财务情况（元）</text>
        </view>
        <view class="row" style="justify-content: flex-start">
          <view style="width: 24rpx; height: 32rpx; margin-right: 10rpx">
            <image src="/pagesWater/static/rightMore.png" style="width: 100%; height: 100%"></image>
          </view>
          <view style="color: #999999; font-size: 26rpx">左滑查看更多</view>
        </view>
      </view>
      <view class="financial row" style="position: relative">
        <view v-if="isDemo != ''" style="
            position: absolute;
            z-index: 99;
            left: 50%;
            top: 50%;
            transform: translate(-50%, -50%);
          ">
          <image src="/pagesWater/static/waterLogo.png" style="width: 320rpx; height: 200rpx"></image>
        </view>
        <!-- 添加组件 -->
        <tableData style="width: 100%;" :tableType="'column'" :tableData="finArr" :colWidth="'48'">
          <view style="display: flex" class="data-row" v-for="(item, index) in finArr" :key="index">
            <view :style="{
              width: 100 / finArr.length + '%',
              padding: index == 0 ? '28rpx 12rpx' : '20rpx 12rpx',
              background: index == 0 ? '#F1F5F9' : '',
            }" class="data-cell" v-for="(v, i) in finTitle.length - 1" :key="i">
              <view v-if="index == 0">
                {{ item["price" + (i + 1)] }}
              </view>
              <view v-else>
                {{ $p(item["price" + (i + 1)]) }}
              </view>
            </view>
          </view>
          <view v-if="finArr.length == 0" style="
              text-align: center;
              line-height: 100rpx;
              height: 100rpx;
              font-size: 26rpx;
              color: #888888;
            ">
            暂无数据
          </view>
        </tableData>
      </view>









    </view>
    <loading :show="loading"></loading>
  </view>
</template>

<script>
import readMore from "@/components/xzj-readMore.vue";
import util from '@/utils/util'
import { getTableWidth } from "@/utils/date";
import { getReportDetailInfoApi, getThreeTaxInfoApi } from "@/api/user";
import { getCreditRatingApi } from "@/api/taxDetail";
import { checkLogin } from "@/libs/login";
import { taxList, threeYearsTaxInfo } from "../../options";
// 添加组件
import tableData from "@/components/tableData.vue";
export default {
  // 添加组件
  components: {
    tableData,
    readMore,
  },
  props: {
    shareCode: {
      type: String,
      default: "",
    },
    taskId: {
      type: String,
      default: "",
    },
    isDemo: {
      type: String,
      default: "",
    },
  },
  data() {
    return {
      tableData: [],
      taxList: {},
      table: [],
      tableWidth: "",
      taxtableWidth: "",
      taxType: true,
      threeType: true,
      // 添加组件
      arrobj: [
        {
          title: "月份",
        },
      ],
      objarr: [],
      loading: false,
      // titleData1,tableData2 - 近两年纳税信用评级
      titleData1: [
        {
          title: "评价年度",
        },
        {
          title: "评价得分",
        },
        {
          title: "评价结果",
        },
        {
          title: "扣减分项",
        },
      ],
      tableData2: [],
      // 违法违规信息
      lawRegulationViolationTitle: [],
      lawRegulationViolationData: [],
      finTitle: [
        {
          month: "财务指标",
        },
      ],
      taxAnalyTitle: [
        {
          month: "纳税数据分析",
        },
      ],
      taxFinArr: [],
      finArr: [],
      current: 0,
      titleMoney: [
        {
          title: "起始时间",
        },
        {
          title: "缴款时间",
        },
        {
          title: "滞纳金金额",
        },
      ],
      tableMoneyData: [],
      moneyType: false,
      moneyIndex: 3,
    };
  },
  // 属性值变化时触发方法执行
  // 缓存：计算属性会基于其依赖进行缓存，只有在依赖发生变化时才会重新计算。简洁：计算属性可以简化模板中的逻辑，使代码更清晰易读。
  computed: {
    shadowStyle() {
      return {
        // #ifndef APP-NVUE
        backgroundImage: "none",
        // #endif
        // #ifdef APP-NVUE
        // nvue上不支持设置复杂的backgroundImage属性
        backgroundImage: "none",
        // #endif
        backgroundImage: "none",
        paddingTop: "100px",
        marginTop: "-100px",
      };
    },
  },
  // created 是 Vue.js 中的一个生命周期钩子方法。它在实例被创建之后立即调用，此时组件的属性和方法已经初始化，但 DOM 还没有被挂载。
  // 通常用于在组件实例化时执行一些初始化操作，例如获取初始数据、设置默认值或执行其他需要在组件创建时完成的任务。
  async created() {
    // 变量初始化
    this.loading = true;
    if (!this.taskId && !this.shareCode) {
      this.taxList = taxList.data;
      this.tableData = threeYearsTaxInfo.data;
      this.tableData.forEach((item, index) => {
        this.arrobj.push({
          title: item.year + "年",
        });
      });
      this.addTableSum(this.tableData);
      this.loading = false;
    } else {
      await this.getReportDetailInfo();
      await this.getThreeTaxInfo();
    }
  },
  // mounted 是 Vue 组件的一个生命周期钩子函数，它在组件被挂载到 DOM 后立即调用
  mounted() {
    if (Object.keys(this.taxList).length > 0) {
      this.tableData = this.taxList.paidTaxesDataList;
      this.tableData2 = this.taxList.creditEvaluationList
        ? this.taxList.creditEvaluationList
        : [];
      this.tableMoneyData = this.taxList.taxLateFeesList;
    }
  },
  //  Vue 组件的 watch 选项，用于监听 taxList 数据的变化，并在数据变化时执行相应的处理逻辑
  watch: {
    taxList: {
      handler(val) {
        // 添加组件头部
        // this.arrobj=[]
        val.enterpriseMonthPaidList.forEach((item, i) => {
          // 添加标题
          this.taxAnalyTitle.push({
            title: `近${item.month}个月`,
          });
          // 初始化 monthData
          item.monthData = [
            {
              name: "欠税金额",
              value: item.taxEnterprisePaidDate.unpaidTaxAmount,
            },
            {
              name: "纳税销售额",
              value: item.taxEnterprisePaidDate.taxSaleAmount,
            },
            {
              name: "纳税实缴金额",
              value: item.taxEnterprisePaidDate.taxPaidAmount,
            },
            {
              name: "0申报月数",
              value: item.taxEnterprisePaidDate.coiled0Months,
            },
            {
              name: "负债率",
              value: item.taxEnterprisePaidDate.debtRatio,
            },
            {
              name: "利润率",
              value: item.taxEnterprisePaidDate.profitRatio,
            },
            {
              name: "增值税应纳额",
              value: item.taxEnterprisePaidDate.vatPayableAmount,
            },
            {
              name: "企业所得税",
              value: item.taxEnterprisePaidDate.taxIncomeAmount,
            },
            {
              name: "减免税额",
              value: item.taxEnterprisePaidDate.taxWaiverAmount,
            },
            {
              name: "滞纳金次数",
              value: item.taxEnterprisePaidDate.lateFeesNum,
            },
            {
              name: "滞纳金金额",
              value: item.taxEnterprisePaidDate.lateFeesAmount,
            },
          ];
        });
        // 转换数据并插入空对象
        this.taxFinArr = this.$util.transformData(
          val.enterpriseMonthPaidList,
          "F"
        );
        this.taxFinArr.unshift({});
        // 更新第一个元素的 month 和 price 属性
        this.taxFinArr[0].month = "纳税数据分析";
        val.enterpriseMonthPaidList.forEach((item, i) => {
          this.taxFinArr[0][`price${i + 1}`] = `近${item.month}个月`;
        });

        // 财务情况
        val.spiderFinanceInfosYearList.forEach((item) => {
          this.finTitle.push({
            title: item.year,
          });
          item.monthData = [
            {
              name: "资产合计",
              value: item.spiderFinanceInfoVo.totalAssets,
            },
            {
              name: "负债合计",
              value: item.spiderFinanceInfoVo.totalLiabilities,
            },
            {
              name: "所有者权益合计",
              value: item.spiderFinanceInfoVo.ownerEquity,
            },
            {
              name: "负债和所有者权益总计",
              value: item.spiderFinanceInfoVo.liabilitiesOwnerEquity,
            },
            {
              name: "营业收入",
              value: item.spiderFinanceInfoVo.businessIncome,
            },
            {
              name: "营业利润",
              value: item.spiderFinanceInfoVo.businessProfit,
            },
            {
              name: "利润总额",
              value: item.spiderFinanceInfoVo.totalProfit,
            },
            {
              name: "净利润",
              value: item.spiderFinanceInfoVo.netProfits,
            },
            {
              name: "现金净增加额",
              value: item.spiderFinanceInfoVo.thisYearNetIncrease,
            },
            {
              name: "期末现金余额",
              value: item.spiderFinanceInfoVo.thisYearFinalBalance,
            },
          ];
        });
        this.finArr = [];
        this.finArr = this.$util.transformData(
          val.spiderFinanceInfosYearList,
          "F"
        );
        this.finArr.unshift({});
        this.finArr[0].month = "财务指标";
        val.spiderFinanceInfosYearList.forEach((item, i) => {
          this.finArr[0][`price${i + 1}`] = item.year + "年";
        });

        // 纳税违法违章信息


        const result = util.setlawRegulationViolationVo(val.lawRegulationViolationVoList)
        this.lawRegulationViolationTitle = val.lawRegulationViolationVoList
        this.lawRegulationViolationData = result


        // 允许你在 DOM 更新完成之后执行某些操作，确保这些操作是在最新的 DOM 状态下进行的。
        this.$nextTick(() => {
          if (Object.keys(val).length > 0 && (this.taskId || this.shareCode)) {
            this.tableData2 = this.taxList.creditEvaluationList
              ? this.taxList.creditEvaluationList
              : [];
            this.tableMoneyData = this.taxList.taxLateFeesList;
            this.addTableSum(this.tableData);
          }
        });
      },
    },
  },
  methods: {
    tabClick(val) {
      if (!this.taskId && !this.shareCode) {
        if (this.current == val) return;
        this.current = val;
      } else {
        this.tableData = [];
        this.arrobj = [];
        if (this.current == val) return;
        this.current = val;
        this.getThreeTaxInfo();
      }
    },
    moneyClick() {
      this.moneyType = !this.moneyType;
      if (this.moneyType) {
        this.moneyIndex = this.tableMoneyData.length;
      } else {
        this.moneyIndex = 3;
      }
    },
    // 表格添加合计行
    addTableSum(table) {
      table?.forEach((item) => {
        if (item.monthData.length < 12) {
          item.monthData.push({
            name: item.monthData.length + (12 - item.monthData.length),
          });
        }
      });
      table &&
        table.forEach((item) => {
          item.monthData.push({
            name: "合计",
            type: 0,
            value: item.total || 0,
          });
        });
      if (table) {
        this.objarr = this.$util.transformData(table);
      }

    },
    // 近三年纳税信息
    getThreeTaxInfo() {
      this.loading = true;
      this.arrobj = [
        {
          title: "月份",
        },
      ];
      this.tableData = [];
      // 请求服务端，获取纳税信息
      getThreeTaxInfoApi({
        taxType: this.current + 1,
        shareCode: this.shareCode,
        taskId: this.taskId,
      })
        .then((res) => {
          this.tableData = res.data;
          this.tableData.forEach((item, index) => {
            this.arrobj.push({
              title: item.year + "年",
            });
          });
          this.addTableSum(this.tableData);
        })
        .finally(() => {
          this.loading = false;
        });
    },
    //获取助融报告-纳税信息页
    getReportDetailInfo() {
      let params = {
        shareCode: this.shareCode,
        taskId: this.taskId,
      };
      getReportDetailInfoApi(params)
        .then((res) => {
          this.taxList = res.data;
        })
        .finally(() => {
          this.loading = false;
        });
    },
  },
};
</script>

<style lang="scss" scoped>
/deep/ .xzj {
  color: #222222 !important;
}

.pding25 {
  padding: 25rpx 0 !important;
}

/deep/ .watchMore {
  margin-top: 0;
  font-size: 24rpx;
}

.w70 {
  width: 45%;
  text-align: left;
  font-size: 28rpx;
  color: #999999;
  //white-space: nowrap;
}

.w30 {
  width: 55%;
  text-align: right;
  font-size: 28rpx;
  color: #222222;
  //white-space: nowrap;
}

.marginL16 {
  margin-left: 36rpx;
}

.cardContent {
  box-shadow: none;
  padding-top: 20rpx;
  padding-bottom: 20rpx;
  border-radius: 0 0 15rpx 15rpx;
  margin-top: 0;
}

.title {
  //background: #F1F5F9;
  padding-top: 10rpx;
  padding-bottom: 10rpx;
  margin: 10rpx 0;
}

.itemTitle {
  background: #f1f5f9;
  color: #a8a8a8;
  //margin-top: 10rpx;
  //margin-bottom: 10rpx;
  //padding: 10rpx 16rpx;
}

.tabClass {
  .first {
    width: 110rpx;
    height: 48rpx;
    background: #e5e5e5;
    font-size: 26rpx;
    color: #111111;
    line-height: 48rpx;
    text-align: center;
    border-radius: 6rpx 0 0 6rpx;
    font-weight: 500;
  }

  .second {
    border-radius: 0 6rpx 6rpx 0;
  }

  .active {
    color: #ffffff;
    background: #488afd;
  }
}

.taxAnaly {
  position: relative;

  .firstCell {
    background: #f8f8f8;
    color: #555555;
    justify-content: flex-start;
  }

  /deep/ .table-container {
    //width: 150%;
  }
}

.financial {
  /deep/ .firstColumn {
    /deep/ .data-cell {
      width: 266rpx;
    }
  }
}

/deep/ .table-container {
  border-radius: 20rpx;
  overflow: hidden;
}

/deep/ .data-cell {
  // padding: 6rpx 10rpx !important;
}
</style>
